<%= organization_page_header('catalogs') %>

<% if @design %>
  <% doc_anchor = 'design' %>
  <%= breadcrumb [{:label => icon(site_icon(:design), 'designs'), :link => catalog_path(:anchor => 'designs')},
                  {:label => @design.ciName, :kind => 'design', :link => catalog_design_path(@design)},
                  {:label => @platform.ciName, :icon => platform_image_url(@platform),
                   :kind  => 'platform',
                   :link  => catalog_design_platform_path(@design, @platform)}] %>
<% else %>
  <%= breadcrumb [{:label => icon(site_icon(:pack), 'packs'),
                   :link  => catalog_path(:anchor => 'packs')},
                  {:kind  => 'source',
                   :label => @platform.ciAttributes.source},
                  {:kind  => 'pack',
                   :label => breadcrumb_platform_label,
                   :icon  => platform_image_url(@platform),
                   :link  => catalog_pack_platform_path(:id => @platform)}] %>
<% end %>

<%= page_title :page_icon  => ci_image_url(@component),
               :page_kind  => "#{@component.ciClassName.split('.').last.capitalize} Component",
               :page_label => @component.ciName,
               :doc_link   => ci_doc_link(@component, icon('book'),
                                          :anchor => @platform.ciClassName.end_with?('catalog.Platform') ? 'design' : 'transition',
                                          :class => 'doc-link') %>

<%= items = [{:label => 'configuration', :template => 'configuration', :selected => true}]
    if @design
      items << {:label => 'attachments', :url => catalog_design_platform_component_attachments_path(@design, @platform, @component)}
      items << {:label => 'monitors',    :url => catalog_design_platform_component_monitors_path(@design, @platform, @component)}
    else
      items << {:label => 'monitors', :url => catalog_pack_platform_component_monitors_path(:platform_id => @platform, :component_id => @component)}
    end
    render 'base/shared/page_nav_pages', :items => items %>
